# $Id$
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: dorphell <dorphell@archlinux.org>

pkgname=w3m
_gitcommit=1ac245bdcd803f69c7793ecccc090a80b1137d35
pkgver=0.5.3.git20170102
pkgrel=2
pkgdesc='Text-based Web browser, as well as pager'
url='http://w3m.sourceforge.net/'
license=('custom')
arch=('i686' 'x86_64')
makedepends=('git' 'imlib2')
optdepends=('imlib2: for graphics support')
depends=('openssl' 'gc' 'ncurses' 'gpm')
source=(${pkgname}::"git+https://anonscm.debian.org/git/collab-maint/w3m.git#commit=${_gitcommit}")
sha256sums=('SKIP')

build() {
	cd "${srcdir}/${pkgname}"
	./configure \
		--prefix=/usr \
		--libexecdir=/usr/lib \
		--enable-image=x11,fb \
		--with-imagelib=imlib2 \
		--with-termlib=ncurses \
		--disable-w3mmailer \

	make
}

package() {
	cd "${srcdir}/${pkgname}"
	make DESTDIR="${pkgdir}" install

	install -d "${pkgdir}"/usr/share/{doc,licenses}/"${pkgname}"
	find doc/* | grep -v CVS | xargs -i install -m644 "{}" "${pkgdir}/usr/share/doc/${pkgname}"
	ln -s ../../doc/"${pkgname}"/README "${pkgdir}/usr/share/licenses/${pkgname}"
}
